<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Vtiful\Kernel\Excel insertFormula</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="vtiful-kernel-excel.header.html">« Vtiful\Kernel\Excel::header</a></li>
      <li style="float: right;"><a href="vtiful-kernel-excel.insertImage.html">Vtiful\Kernel\Excel::insertImage »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.vtiful-kernel-excel.html">Vtiful\Kernel\Excel</a></li>
    <li>Vtiful\Kernel\Excel insertFormula</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="vtiful-kernel-excel.insertFormula" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Vtiful\Kernel\Excel::insertFormula</h1>
  <p class="verinfo">(PECL xlswriter &gt;= 1.2.1)</p><p class="refpurpose"><span class="refname">Vtiful\Kernel\Excel::insertFormula</span> &mdash; <span class="dc-title">Vtiful\Kernel\Excel insertFormula</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-vtiful-kernel-excel.insertFormula-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Vtiful\Kernel\Excel::insertFormula</strong></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$row</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$column</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$formula</code></span>)</div>

  <p class="para rdfs-comment">
    Insert calculation formula.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-vtiful-kernel-excel.insertFormula-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">row</code></dt>

    <dd>

     <p class="para">
      cell row
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">column</code></dt>

    <dd>

     <p class="para">
      cell column
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">formula</code></dt>

    <dd>

     <p class="para">
      formula string
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-vtiful-kernel-excel.insertFormula-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   <span class="classname"><a href="class.vtiful-kernel-excel.html" class="classname">Vtiful\Kernel\Excel</a></span> instance
  </p>
 </div>


<div class="refsect1 examples" id="refsect1-vtiful-kernel-excel.insertFormula-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="example-3198">
   <p><strong>示例 #1 example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$config&nbsp;</span><span style="color: #007700">=&nbsp;[<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'path'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'./tests'<br /></span><span style="color: #007700">];<br /><br /></span><span style="color: #0000BB">$excel&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;\</span><span style="color: #0000BB">Vtiful</span><span style="color: #007700">\</span><span style="color: #0000BB">Kernel</span><span style="color: #007700">\</span><span style="color: #0000BB">Excel</span><span style="color: #007700">(</span><span style="color: #0000BB">$config</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$file&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$excel</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">fileName</span><span style="color: #007700">(</span><span style="color: #DD0000">"free.xlsx"</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;-&gt;</span><span style="color: #0000BB">header</span><span style="color: #007700">([</span><span style="color: #DD0000">'name'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'money'</span><span style="color: #007700">]);<br /><br />for(</span><span style="color: #0000BB">$index&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">$index&nbsp;</span><span style="color: #007700">&lt;&nbsp;</span><span style="color: #0000BB">10</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">$index</span><span style="color: #007700">++)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$file</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">insertText</span><span style="color: #007700">(</span><span style="color: #0000BB">$index</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'viest'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$file</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">insertText</span><span style="color: #007700">(</span><span style="color: #0000BB">$index</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">10</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #0000BB">$file</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">insertText</span><span style="color: #007700">(</span><span style="color: #0000BB">12</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"Total"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$file</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">insertFormula</span><span style="color: #007700">(</span><span style="color: #0000BB">12</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'=SUM(B2:B11)'</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;insert&nbsp;formula<br /><br /></span><span style="color: #0000BB">$file</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">output</span><span style="color: #007700">();</span>
</span>
</code></div>
   </div>

  </div>
 </div>


</div></div></div></body></html>